<h3><?php echo $title; ?></h3>



<?php 
//$id = $this->uri->segment(4);
//
$row= $result[0];

echo form_open_multipart('admin/customer/update/'.$row['id']); ?>

<div class="control2">

<?php

	echo form_submit('update', 'Save');

	echo form_submit('close', 'Close');

?>

</div><!--control2 end-->


<div class="box_ex">

<?php 

//  echo '<p class="error">Các thông tin đánh dấu * là bắt buộc</p>';

   
   if(isset($missing) && is_array($missing) )
   {
  
   echo "<div class='error' style='text-align:center'>";
   foreach($missing as $item)
   {
   		echo $item."<br />";
   }
   echo "</div>";
   }
  
  //================THÔNG TIN XÁC THỰC================

  echo '<p class="title">THÔNG TIN XÁC THỰC</p>';



  


  //Email

	echo '<div class="inner">';

  $code = 'email';
  $label = "Email";
	if (! empty($missing) && array_key_exists('email', $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
			echo form_label($label, '', array('class'=>'width-185'));

$data = array('name'=>$code, 'class'=>'width-185','value'=>$row['email']);

  echo form_input($data, set_value($code));
	echo '</div>';



  //Password

	echo '<div class="inner">';

  $code = 'password';
$label = "Password";
//  $label = $field['private'][$code].'*';

//	if (! empty($missing) && array_key_exists($code, $missing))

	//	echo form_label($label, '', array('class'=>'error width-185'));

//	else
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
		echo form_label($label, '', array('class'=>'width-185'));

	echo form_password($code);

	echo '</div>';






  //================THÔNG TIN CÁ NHÂN================

  echo '<p class="title">THÔNG TIN CÁ NHÂN</p>';

 $name= unserialize($row["name"]);


  //Họ lót

	echo '<div class="inner">';

  $code = 'last_name';

  $label = 'Last name';

 if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
		echo form_label($label, '', array('class'=>'width-185'));
 $data = array('name'=>$code, 'value'=>html_entity_decode($name['last_name'],ENT_QUOTES,"UTF-8") );
  echo form_input($data, set_value($code));

	echo '</div>';



  //Tên

	echo '<div class="inner">';

  $code = 'first_name';

  $label ='First name';

 if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else

		echo form_label($label, '', array('class'=>'width-185'));
 $data = array('name'=>$code, 'value'=>html_entity_decode($name['first_name'],ENT_QUOTES,"UTF-8"));
  echo form_input($data, set_value($code));

	echo '</div>';



  //Ngày sinh

	echo '<div class="inner">';

  $code = 'birthday';

  $label = 'Birthday';
  if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else

		echo form_label($label, '', array('class'=>'width-185'));

  $data = array('name'=>$code, 'id'=>"datePicker", 'class'=>'date', 'title'=>'dd-mm-yyyy','value'=>$row['birthday']);
//$data = array('name'=>$code, 'class'=>'width-185','value'=>$row['user_name']);

 
	echo form_input($data).'<a href="javascript: NewCssCal(\'datePicker\', \'ddmmyyyy\')"><img src="http://bcb/images/admin/timepicker/calendar.png" border="0" /></a>';

	echo '</div>';



  //Giới tính

	echo '<div class="inner">';

  $code = 'sex';

  $label = 'Sex';

  echo form_label($label, '', array('class'=>'width-185'));

	$data = array('name' => 'sex', 'value' => '1', 'checked'=>'checked');

  echo form_radio($data);

  echo '<span style="margin-right:10px;">Nam</span>';

  $data = array('name' => 'sex', 'value' => '2');

  echo form_radio($data);

  echo '<span>Nữ</span>';

	echo '</div>';



  //Địa chỉ

	echo '<div class="inner">';

  $code = 'address';

  $label = 'Address';
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
  echo form_label($label, '', array('class'=>'width-185'));

  $data = array('name'=>$code, 'class'=>'width-530','value'=>$row['address']);

	echo form_input($data,set_value($code));

	echo '</div>';



  //Di động

	echo '<div class="inner">';

  $code = 'phone';

  $label = "Phone";
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
  echo form_label($label, '', array('class'=>'width-185'));


  $data = array('name'=>$code, 'class'=>'width-530','value'=>$row['phone']);

	echo form_input($data,set_value($code));

	echo '</div>';

 //ten cong ty

	echo '<div class="inner">';

  $code = 'company';

  $label = "Tên công ty";
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
  echo form_label($label, '', array('class'=>'width-185'));

	$data = array('name'=>$code, 'class'=>'width-530','value'=>$row['company']);

	echo form_input($data,set_value($code));

	echo '</div>';




  //tax

	echo '<div class="inner">';

  $code = 'tax';

  $label = "tax";
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
  echo form_label($label, '', array('class'=>'width-185'));

	$data = array('name'=>$code, 'class'=>'width-530','value'=>$row['tax']);

	echo form_input($data,set_value($code));


	echo '</div>';



  //the thanh vien

	echo '<div class="inner">';

  $code = 'member_card';

  $label = "Mã thẻ thành viên";
if (! empty($missing) && array_key_exists($code, $missing))

		echo form_label($label, '', array('class'=>'error width-185'));

	else
  echo form_label($label, '', array('class'=>'width-185'));

$data = array('name'=>$code, 'class'=>'width-530','value'=>$row['member_card']);

	echo form_input($data,set_value($code));


	echo '</div>';












?>

</div><!--end box-->



<?php

	echo form_close(); //FORM END

?>



<script type="text/javascript">

	$(function(){

		// Datepicker

		$('#birthday, #opt3_11, #opt3_12').Datepicker({

			dateFormat: 'dd-mm-yy'

		});

	});

</script>